home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_kdelibs.idb / usr / freeware / kde / include / kfilepreview.h.z / kfilepreview.h
Encoding:
C/C++ Source or Header  |  1999-01-26  |  2.3 KB  |  74 lines

  1. /* This file is part of the KDE libraries
  2.     Copyright (C) 1998 Stephan Kulow <coolo@kde.org>
  3.                   1998 Daniel Grana <grana@ie.iwi.unibe.ch>
  4.       
  5.     This library is free software; you can redistribute it and/or
  6.     modify it under the terms of the GNU Library General Public
  7.     License as published by the Free Software Foundation; either
  8.     version 2 of the License, or (at your option) any later version.
  9.  
  10.     This library is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.     Library General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU Library General Public License
  16.     along with this library; see the file COPYING.LIB.  If not, write to
  17.     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18.     Boston, MA 02111-1307, USA.
  19. */
  20.  
  21. #ifndef _KFILEPREVIEW_H
  22. #define _KFILEPREVIEW_H
  23.  
  24. #include "kpreview.h"
  25. #include "kfileinfocontents.h"
  26. #include "knewpanner.h"
  27. #include "kdir.h"
  28.  
  29. class KFilePreview: protected KNewPanner, public KFileInfoContents
  30. {
  31.     Q_OBJECT
  32.     
  33. public:
  34.  
  35.     KFilePreview( KDir *inDir, bool s, QDir::SortSpec sorting,
  36.         QWidget * parent=0, const char * name=0 );
  37.     ~KFilePreview();
  38.     
  39.     virtual QWidget *widget() { return this; }
  40.     virtual void setAutoUpdate(bool);
  41.     virtual void setCurrentItem(const char *filename, const KFileInfo *i);
  42.     virtual void repaint(bool f = true);
  43.  
  44.     virtual QString findCompletion( const char *base, bool activateFound );
  45.  
  46.     virtual bool acceptsFiles() { return true; }
  47.     virtual bool acceptsDirs() { return true; }
  48.  
  49.     void registerPreviewModule( const char * format, PreviewHandler readPreview,
  50.                                 PreviewType inType);
  51.  
  52. protected slots:
  53.     
  54.     void dirActivated(KFileInfo *);
  55.     void fileActivated(KFileInfo *);
  56.     void fileHighlighted(KFileInfo *);
  57.  
  58. protected:
  59.     
  60.     virtual KFileInfoContents *getDirList() { return 0; }
  61.     virtual KFileInfoContents *getFileList() { return 0; }
  62.  
  63.     virtual void highlightItem(unsigned int item);
  64.     virtual void clearView();
  65.     virtual bool insertItem(const KFileInfo *i, int index);
  66.     
  67. private:
  68.     KFileInfoContents *fileList;
  69.     KPreview *myPreview;
  70.  
  71. };
  72.  
  73. #endif
  74.